var app = getApp()

function getSettings(callback,fail) {
  app.func.Post(false, app.api.get_settings, function (res) {
    typeof callback == "function" && callback(res)
  }, function (error) {
    typeof fail == "function" && fail(error);
  })
};
function sendCode(data, callback,fail) {
  app.func.Post(false, app.api.send_code, data, function (res) {
    typeof callback == "function" && callback(res)
  }, function (error) {
    typeof fail == "function" && fail(error);
  })
};

function bindPhone(data, callback,fail) {
  app.func.Post(false, app.api.bind_phone, data, function (res) {
    typeof callback == "function" && callback(res)
  }, function (error) {
    typeof fail == "function" && fail(error);
  })
};
function checkCode(data, success,fail) {
  app.func.Post(false, app.api.check_code, data, function (res) {
    typeof success == "function" && success(res)
  },function (error) {
      typeof fail == "function" && fail(error);
    })
};
function resetPassword(data, callback,fail) {
  app.func.Post(false, app.api.reset_password, data, function (res) {
    typeof callback == "function" && callback(res)
  }, function (error) {
    typeof fail == "function" && fail(error);
  })
};
module.exports = {
  // 我的设置接口
  getSettings: getSettings,
  // 绑定手机号接口
  bindPhone: bindPhone,
  // 获取验证码
  sendCode: sendCode,
  checkCode: checkCode,
  resetPassword: resetPassword,
};